package com.indexingsystem.boss.entity;

import java.io.Serializable;

public class ResourceRelations implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String resRelationId;

	private String fristResId;

	private String secondResId;

	private Integer relationType;

	public String getResRelationId() {
		return resRelationId;
	}

	public void setResRelationId(String resRelationId) {
		this.resRelationId = resRelationId == null ? null : resRelationId.trim();
	}

	public String getFristResId() {
		return fristResId;
	}

	public void setFristResId(String fristResId) {
		this.fristResId = fristResId == null ? null : fristResId.trim();
	}

	public String getSecondResId() {
		return secondResId;
	}

	public void setSecondResId(String secondResId) {
		this.secondResId = secondResId == null ? null : secondResId.trim();
	}

	public Integer getRelationType() {
		return relationType;
	}

	public void setRelationType(Integer relationType) {
		this.relationType = relationType;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((fristResId == null) ? 0 : fristResId.hashCode());
		result = prime * result + ((relationType == null) ? 0 : relationType.hashCode());
		result = prime * result + ((resRelationId == null) ? 0 : resRelationId.hashCode());
		result = prime * result + ((secondResId == null) ? 0 : secondResId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ResourceRelations other = (ResourceRelations) obj;
		if (fristResId == null) {
			if (other.fristResId != null)
				return false;
		} else if (!fristResId.equals(other.fristResId))
			return false;
		if (relationType == null) {
			if (other.relationType != null)
				return false;
		} else if (!relationType.equals(other.relationType))
			return false;
		if (resRelationId == null) {
			if (other.resRelationId != null)
				return false;
		} else if (!resRelationId.equals(other.resRelationId))
			return false;
		if (secondResId == null) {
			if (other.secondResId != null)
				return false;
		} else if (!secondResId.equals(other.secondResId))
			return false;
		return true;
	}

	public ResourceRelations() {
		super();
	}

	public ResourceRelations(String resRelationId, String fristResId, String secondResId, Integer relationType) {
		super();
		this.resRelationId = resRelationId;
		this.fristResId = fristResId;
		this.secondResId = secondResId;
		this.relationType = relationType;
	}

	@Override
	public String toString() {
		return "ResourceRelations [resRelationId=" + resRelationId + ", fristResId=" + fristResId + ", secondResId="
				+ secondResId + ", relationType=" + relationType + "]";
	}
}